package x.x.designpattern.observer;

public class MainObserver {
    public static void main(String[] args) {
        Food food = new Food("土豆",1F);
        Customer zhangsan = new Customer("张三");
        Customer lisi = new Customer("李四");
        /**
         * 添加顾客
         */
        food.addObserver(zhangsan);
        food.addObserver(lisi);
        /**
         * 更新价格
         */
        food.setPrice(2L);
        
    }
}
